<?php
declare(strict_types=1);
/**
 * Created by PhpStorm
 * User: Administrator
 * Date: 2023/4/11
 * Time: 14:53:53
 */

namespace Service\PayService;
use Service\PayService\CashPayService;

class Pay extends \Service\BaseService
{
    protected $pay_way;
    public function index(array $param=[]){
//        if($param['store_type']==2){
//            $config= \Ly\Model\ConfigChannel::instance()->getConfig(['cid'=>$param['cid'],'code'=>'pay_way']);
//        }elseif($param['store_type']==3){
//            $config= \Ly\Model\StoreConfig::instance()->getConfig(['mn_sid'=>$param['mn_sid'],'code'=>'pay_way']);
//        }
//        if(isset($config['data']['value']['type'])){
//            $payway= $this->pay_way[$config['data']['value']['type']];
//        }else{
//            $payway='weixin';
//        }
        $this->pay_way = CashPayService::instance()->pay_way;
        $payway = $this->pay_way[$param['scan_rece_type']];
        return $this->{$payway}($param);
    }
}